Repository navigation
Keep templates and macros per weblog, and bound render output and time - #367
Merged
Merged
Conversation
The Roller 7 version of #366, and a slimmer version of #317 without the in-memory render budget. #parse and #include load only the rendering weblog's own templates, inline macros are local to the template that defines them, and a render fails once it writes more than rendering.maxOutputChars, runs past rendering.maxRenderSeconds, or makes more than 100,000 #foreach passes. $utils.addNofollow stays available. The security model puts template resource use out of scope: a global admin who turns on custom themes trusts weblog Admins not to abuse the server's CPU and memory. The template sandbox stays a security boundary. Co-authored-by: Matt Raible <matt@raibledesigns.com>
mraible
approved these changes
Nov 21, 2026
mraible
left a comment
Contributor
There was a problem hiding this comment.
Looks good. I compared it with the trimmed #317: the rendering code, the Velocity settings and the security model change are the same, and keeping $utils.addNofollow available is better than another breaking change in 7.0. A small thing you could fix while you're there: the template guide lists the method as addNowFollow, which was already wrong on master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Roller 7 version of #366, and a smaller alternative to #317. It keeps #317's template isolation and output/time limits, and leaves out the in-memory render budget (
RenderLimitParser,RenderLimitUberspector,StringGrowth,DeadlineRegex,ValueLimits). It also changes the security model to put template resource use out of scope.#parseand#includeload only that weblog's stored templates. Inline macros are local to the template that defines them (local_scope=true,replace_global=true). Library macros stay global. Error pages no longer show template ids. Unlike Bound weblog template rendering and keep templates and macros per weblog #317,$utils.addNofollowstays available.rendering.maxOutputChars(10 MB), inserts a longer string, or runs pastrendering.maxRenderSeconds(30 s). Writes, reference insertions and every#foreachpass check the limits. A#foreachof more than 100,000 passes fails the render.docs/security-model.md: a global admin who turns on custom themes (off by default) trusts weblog Admins not to abuse the server's CPU and memory. The template sandbox stays a security boundary: no Java calls, no file reads, no access to other weblogs.Status: all 29 test classes under
ui/renderingpass (107 tests). The limits don't stop every expensive template, which the model change now says. The model text matches #366. Whenroller-6.1.xis next merged into master, keep master's copy ofdocs/security-model.md.Behavior change: a custom theme that calls a macro defined in a template it doesn't
#parsenow prints the call as text. See CHANGES.md.